package com.ruoyi.product.service.impl;

import com.ruoyi.product.domain.Product;
import com.ruoyi.product.mapper.ProductMapper;
import com.ruoyi.product.service.ProductService;
import com.ruoyi.res_banner.domain.Res_Banner;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ProductServiceImpl implements ProductService {
    @Autowired
    ProductMapper mapper;
    //1 查询特产列表
    @Override
    public List<Product> getProductList(Product p){
        return mapper.getProductList(p);
    }
    //2 查询特产详情
    @Override
    public List<Product> selectProductList(Product p) {
        return mapper.selectProductList(p);
    }
    //3 新增特产
    @Override
    public int addProduct(Product p) {
        return mapper.addProduct(p);
    }

    @Override
    public void updateProduct(Product p) {
        mapper.updateProduct(p);
    }

    //5 删除特产
    @Override
    public void deleteProduct(int id) {
        mapper.deleteProduct(id);
    }

    @Override
    public List<Product> queryProductByname(String name) {
        return mapper.queryProductByname(name);
    }


}
